package com.unf.edu.rms.controller.validation;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.unf.edu.rms.controller.facultyresearch.FacultyResearchController;
import com.unf.edu.rms.dao.FacultyResearch;

public class FacultyResearchValidator implements Validator{

	@Override
	public boolean supports(Class<?> arg0) {
		return FacultyResearchController.class.equals(arg0);
		
	}

	@Override
	public void validate(Object obj, Errors errors) {
		System.out.println("UserLoginValidator.validate()==============");
		FacultyResearch facultyResearch = (FacultyResearch)obj;
		ValidationUtils.rejectIfEmpty(errors, "faculty.facultyId", "error.facultyid.required");
		ValidationUtils.rejectIfEmpty(errors, "category.categoryId", "error.categoryid.required");
		ValidationUtils.rejectIfEmpty(errors, "title", "error.title.required");
		//ValidationUtils.rejectIfEmpty(errors, "description", "error.FRdescription.required");
		ValidationUtils.rejectIfEmpty(errors, "status", "error.status.required");
		
	}
}
